package com.tiantang.cp.api.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tiantang.cp.api.bean.Pager;
import com.tiantang.cp.api.bean.TbComicChapter;
import com.tiantang.cp.api.bean.TbComicFile;
import com.tiantang.cp.api.bean.TbComicInfo;
import com.tiantang.cp.api.mapper.TbComicChapterMapper;
import com.tiantang.cp.api.mapper.TbComicFileMapper;
import com.tiantang.cp.api.mapper.TbComicInfoMapper;

@Service
public class ComicService {

	@Autowired
	private TbComicInfoMapper comicInfoMapper;
	
	@Autowired
	private TbComicChapterMapper comicChapterMapper;
	
	@Autowired
	private TbComicFileMapper comicFileMapper;
	
	public List<TbComicInfo> getComicList(Pager pager){
		return comicInfoMapper.select(pager);
	}
	
	public List<TbComicChapter> getChapters(Long comicId){
		return comicChapterMapper.select(comicId);
	}
	
	public List<TbComicFile> getComicFiles(Long chapterId){
		return comicFileMapper.select(chapterId);
	}
	
}
